Skip to content

Use .data.rel.ro section for message globals.#26671

Draft
copybara-service[bot] wants to merge 1 commit intomainfrom
test_892545502
Draft

Use .data.rel.ro section for message globals.#26671
copybara-service[bot] wants to merge 1 commit intomainfrom
test_892545502

Conversation

@copybara-service
Copy link
Copy Markdown

@copybara-service copybara-service bot commented Apr 1, 2026

Use .data.rel.ro section for message globals.

Putting message globals on .data.rel.ro section has two benefits:

(1) makes it truly read only and forces seg faults rather than subtle bug when
users unintentionally mutate the default instance.
(2) collocates it on the same section where the type's other const data (vtbl).

Putting message globals on .data.rel.ro section has two benefits:

(1) makes it truly read only and forces seg faults rather than subtle bug when
    users unintentionally mutate the default instance.
(2) collocates it on the same section where the type's other const data (vtbl).

PiperOrigin-RevId: 892545502
@copybara-service copybara-service bot changed the title Internal change Use .data.rel.ro section for message globals. Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant